<?php

namespace App\Http\Controllers\Wechat;

use App\Http\Service\UserInterface;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Mews\Captcha\Facades\Captcha;

class UserController extends Controller
{
    //
    public $user;

    public function __construct(UserInterface $user)
    {
        $this->user = $user;
    }

    public function getCaptcha()
    {
        return Captcha::create('flat');
    }

    public function login(Request $request)
    {
        $data = $request -> all();
        return $this->user->login($data);
    }
}
